<?php
function smarty_modifier_starval($stars)
{
    $stars = floatval($stars);
    $ext = $stars - intval($stars);
    if($ext == 0){
        $extval = 0;
    }elseif($ext > 0 && $ext <= 0.5){
        $extval = 0.5;
    }elseif($ext > 0.5){
        $extval = 1;
    }
    return intval($stars) + $extval;
}

/* vim: set expandtab: */

?>
